Attribute VB_Name = "PlaySound"
Public Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long

Public Sub PlaySnd()
Dim sFile As String
    'Just plays the start.wav in Windows\media
    sFile = FixPath(Environ("WINDIR")) & "Media\start.wav"
    'Check if file is found.
    If IsFileHere(sFile) Then
        'Play the file.
        PlaySound sFile, App.hInstance, SND_FILENAME Or SND_ASYNC
    End If
    
    sFile = vbNullString
    
End Sub

Public Function FixPath(lPath As String) As String
    If Right(lPath, 1) = "\" Then
        FixPath = lPath
    Else
        FixPath = lPath & "\"
    End If
End Function

Public Function IsFileHere(ByVal lzFilename As String) As Boolean
    If Len(lzFilename) = 0 Then
        IsFileHere = False
        Exit Function
    End If
    
    If LenB(Dir(lzFilename)) = 0 Then
        IsFileHere = False
        Exit Function
    Else
        IsFileHere = True
    End If
    
End Function
